﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Revis.VClinicNet.Core.Domain
{
    public class Card
    {
        public virtual IList<Entry> Entries { get; protected set; }

        public Card()
        {
            Entries = new List<Entry>();
        }

        public virtual void Add(Entry entry)
        {
            if(entry == null) {
                throw new ArgumentNullException("Nie można dodać pustego wpisu");
            }
            Entries.Add(entry);
        }

        public virtual Entry Last()
        {            
            return Entries.Last();
        }

        public virtual bool Remove(Entry entry)
        {
            return Entries.Remove(entry);
        }
        
        public virtual void RemoveAll()
        {
            Entries.Clear();
        }
    }
}
